Component({
  data: {
    selected: 0,
    color: "#7A7E83",
    selectedColor: "#3cc51f",
    "list": [
      {
        "pagePath": "/pages/mq/mqttClient",
        "iconPath": "/pages/image/icon_component.png",
        "selectedIconPath": "/pages/image/icon_component_HL.png",
        "text": "组件"
      },
      {
        "pagePath": "/pages/mqdevice1/mqttClient1",
        "iconPath": "/pages/image/weather1.png",
        "selectedIconPath": "/pages/image/weather2.png",
        "text": "天气"
      },
      {
        "pagePath": "/pages/map/index",
        "iconPath": "/pages/image/map1.png",
        "selectedIconPath": "/pages/image/map2.png",
        "text": "地图"
      }
    ]
  },
  attached() {
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({url})
      this.setData({
        selected: data.index
      })
    }
  }
})